package com.project.communitymanagement.controller;

import com.project.communitymanagement.common.BaseController;
import com.project.communitymanagement.common.Request;
import com.project.communitymanagement.common.ResponseEntity;
import com.project.communitymanagement.entity.TbEpidemic;
import com.project.communitymanagement.service.TbEpidemicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ProjectName: epidemic-prevention-backend
 * @Package: com.project.communitymanagement.controller
 * @ClassName: TbEpidemicController
 * @Author: "XGP"
 * @Description:
 * @Date: 2022/03/25 09:38
 * @Version: 1.0
 */
@RestController
@CrossOrigin
@RequestMapping("tbepidemic")
public class TbEpidemicController extends BaseController<TbEpidemicService, TbEpidemic> {

    @Autowired
    private TbEpidemicService tbepidemicService;

    @Override
    protected TbEpidemicService service() {
        return tbepidemicService;
    }

    @PostMapping("updateArray")
    public ResponseEntity updateArray(@RequestBody Request<List<TbEpidemic>> data) {
        return ResponseEntity.success(tbepidemicService.updateArray(data.getData()));
    }
}

